export const IS_DEV = process.env.NODE_ENV === 'development';

export const STATUS_MAP: Record<string, string> = {
  '1': 'Valid',
  '0': 'Invalid',
};

export const STATE_MAP: Record<string, string> = {
  '0': 'Enabled',
  '1': 'Disabled',
};

// 0-成功 1-拒绝
export const STRATEGY_TYPE_MAP: Record<string, string> = {
  '0': 'Success',
  '1': 'Reject',
};

export const YN_MAP = {
  '1': 'Yes',
  '0': 'No',
};

export const YN_MAP2 = {
  Y: 'Yes',
  N: 'No',
};

export const PR_AUDIT_RESULT_MAP = {
  Y: 'Approved',
  N: 'Declined',
};

export const MAP_DATA = {
  STATUS_MAP,
  STATE_MAP,
  YN_MAP,
  YN_MAP2,
  STRATEGY_TYPE_MAP,
};

export const STATUS_OPTIONS = Object.keys(STATUS_MAP).map((key) => ({
  label: `${key} - ${STATUS_MAP[key]}`,
  value: key,
}));

export const STATE_OPTIONS = Object.keys(STATE_MAP).map((key) => ({
  label: `${key} - ${STATE_MAP[key]}`,
  value: key,
}));

export const STRATEGY_TYPE_OPTIONS = Object.keys(STRATEGY_TYPE_MAP).map(
  (key) => ({
    label: `${key} - ${STRATEGY_TYPE_MAP[key]}`,
    value: key,
  }),
);

export const SELECT_OPTIONS = {
  STATE_OPTIONS,
  STATUS_OPTIONS,
  STRATEGY_TYPE_OPTIONS,
};

export const BASE_URL = IS_DEV ? '/api/anyics-front' : '/';
export const AUTH_API_URL = IS_DEV ? '/any-api/auth-api' : '/';

